package com.cskaoyan.wx.controller;


import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.wx.service.WxCatalogService;
import com.cskaoyan.wx.vo.CurrentCategoryVO;
import com.cskaoyan.wx.vo.WxCatalogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx")
public class WxCatalogController {
    @Autowired
    WxCatalogService wxCatalogService;

    @GetMapping("catalog/index")
    public BaseRespVo catalogIndex(){
        WxCatalogVO wxcatalogVO = wxCatalogService.getCatalogIndex();
        return BaseRespVo.ok(wxcatalogVO);
    }

    @GetMapping("catalog/current")
    public BaseRespVo catalogCurrent(Integer id){
        CurrentCategoryVO currentCategoryVO = wxCatalogService.getCurrentCatalog(id);
        return BaseRespVo.ok(currentCategoryVO);
    }
}
